<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.1.1">
<meta name="baidu-site-verification" content="code-hkfwkpUecU" />
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">
  <meta name="baidu-site-verification" content="true">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Monda:300,300italic,400,400italic,700,700italic|Roboto+Slab:300,300italic,400,400italic,700,700italic|PT+Mono:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.14.0/css/all.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"github.com","root":"/","scheme":"Gemini","version":"8.0.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":true,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"disqus","storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}};
  </script>

  <meta name="description" content="密码学主要解决的问题 信息的机密性、完整性、不可否认性和可用性 机密性：对传送的信息进行加密就可以实现机密性，保证信息不泄露给未经授权的人。 完整性：防止信息被未经授权的人篡改，保证信息不被篡改 不可否认性：保证信息行为人不能否认其信息行为 可用性：保证信息及信息系统确实为授权使用者所用  密码学起源与发展 古典密码学 典型的古典密码算法包括凯撒（Caeser) 密码和维基利亚（Vigenere）">
<meta property="og:type" content="article">
<meta property="og:title" content="密码学概述">
<meta property="og:url" content="https://github.com/shanlu123/2020/09/26/%E5%AF%86%E7%A0%81%E5%AD%A6/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%A6%82%E8%BF%B0/index.html">
<meta property="og:site_name" content="shanlu的博客">
<meta property="og:description" content="密码学主要解决的问题 信息的机密性、完整性、不可否认性和可用性 机密性：对传送的信息进行加密就可以实现机密性，保证信息不泄露给未经授权的人。 完整性：防止信息被未经授权的人篡改，保证信息不被篡改 不可否认性：保证信息行为人不能否认其信息行为 可用性：保证信息及信息系统确实为授权使用者所用  密码学起源与发展 古典密码学 典型的古典密码算法包括凯撒（Caeser) 密码和维基利亚（Vigenere）">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="c:/Users/高萍/AppData/Roaming/Typora/typora-user-images/image-20200926111012355.png">
<meta property="og:image" content="c:/Users/高萍/AppData/Roaming/Typora/typora-user-images/image-20200926114849663.png">
<meta property="og:image" content="c:/Users/高萍/AppData/Roaming/Typora/typora-user-images/image-20200926114859071.png">
<meta property="article:published_time" content="2020-09-25T16:00:00.000Z">
<meta property="article:modified_time" content="2020-10-04T09:07:18.525Z">
<meta property="article:author" content="shanlu">
<meta property="article:tag" content="密码学">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="c:/Users/高萍/AppData/Roaming/Typora/typora-user-images/image-20200926111012355.png">


<link rel="canonical" href="https://github.com/shanlu123/2020/09/26/%E5%AF%86%E7%A0%81%E5%AD%A6/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%A6%82%E8%BF%B0/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>密码学概述 | shanlu的博客</title>
  






  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>
  <a href="https://github.com/shanlu123" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">shanlu的博客</h1>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">三餐四季，冷暖自知</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/home" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-前端">

    <a href="/%E5%89%8D%E7%AB%AF/" rel="section"><i class="fa fa-cloud fa-fw"></i>前端</a>

  </li>
        <li class="menu-item menu-item-生活">

    <a href="/%E7%94%9F%E6%B4%BB/" rel="section"><i class="fa fa-user fa-fw"></i>生活</a>

  </li>
        <li class="menu-item menu-item-school">

    <a href="/school/" rel="section"><i class="fa fa-graduation-cap fa-fw"></i>学校</a>

  </li>
        <li class="menu-item menu-item-tree_hole">

    <a href="/tree_hole/" rel="section"><i class="fa fa-tree fa-fw"></i>树洞</a>

  </li>
        <li class="menu-item menu-item-photos">

    <a href="/photos/" rel="section"><i class="fa fa-camera fa-fw"></i>相册</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <section class="post-toc-wrap sidebar-panel">
          <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%86%E7%A0%81%E5%AD%A6%E4%B8%BB%E8%A6%81%E8%A7%A3%E5%86%B3%E7%9A%84%E9%97%AE%E9%A2%98"><span class="nav-number">1.</span> <span class="nav-text">密码学主要解决的问题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%86%E7%A0%81%E5%AD%A6%E8%B5%B7%E6%BA%90%E4%B8%8E%E5%8F%91%E5%B1%95"><span class="nav-number">2.</span> <span class="nav-text">密码学起源与发展</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%86%E7%A0%81%E5%AD%A6%E6%A6%82%E5%BF%B5"><span class="nav-number">3.</span> <span class="nav-text">密码学概念</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%86%E7%A0%81%E7%B3%BB%E7%BB%9F%E6%9E%84%E6%88%90"><span class="nav-number">4.</span> <span class="nav-text">密码系统构成</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%86%E7%A0%81%E7%B3%BB%E7%BB%9F%E6%95%B0%E5%AD%A6%E6%A8%A1%E5%9E%8B"><span class="nav-number">5.</span> <span class="nav-text">密码系统数学模型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%87%AF%E6%92%92%E5%AF%86%E7%A0%81%E4%BD%93%E5%88%B6"><span class="nav-number">6.</span> <span class="nav-text">凯撒密码体制</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BF%9D%E5%AF%86%E7%B3%BB%E7%BB%9F"><span class="nav-number">7.</span> <span class="nav-text">保密系统</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%AE%A4%E8%AF%81%E4%B8%8E%E8%AE%A4%E8%AF%81%E7%B3%BB%E7%BB%9F"><span class="nav-number">8.</span> <span class="nav-text">认证与认证系统</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%86%E9%92%A5%E4%BD%93%E5%88%B6%E5%88%86%E7%B1%BB"><span class="nav-number">9.</span> <span class="nav-text">密钥体制分类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B5%81%E5%AF%86%E7%A0%81%E5%92%8C%E5%88%86%E7%BB%84%E5%AF%86%E7%A0%81%EF%BC%88%E5%AF%B9%E7%A7%B0%E5%AF%86%E7%A0%81%E4%BD%93%E5%88%B6%EF%BC%89"><span class="nav-number">10.</span> <span class="nav-text">流密码和分组密码（对称密码体制）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B5%81%E5%AF%86%E7%A0%81%E5%92%8C%E5%88%86%E7%BB%84%E5%AF%86%E7%A0%81%E4%B8%BB%E8%A6%81%E5%8C%BA%E5%88%AB%EF%BC%9A"><span class="nav-number">11.</span> <span class="nav-text">流密码和分组密码主要区别：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%B9%E7%A7%B0%E5%AF%86%E7%A0%81%E4%BD%93%E5%88%B6%E4%B8%8E%E9%9D%9E%E5%AF%B9%E7%A7%B0%E5%AF%86%E7%A0%81%E4%BD%93%E5%88%B6%E4%BC%98%E7%BC%BA%E7%82%B9"><span class="nav-number">12.</span> <span class="nav-text">对称密码体制与非对称密码体制优缺点</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%86%E7%A0%81%E7%B3%BB%E7%BB%9F%E6%94%BB%E5%87%BB"><span class="nav-number">13.</span> <span class="nav-text">密码系统攻击</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8F%A4%E5%85%B8%E5%AF%86%E7%A0%81"><span class="nav-number">14.</span> <span class="nav-text">古典密码</span></a></li></ol></div>
      </section>
      <!--/noindex-->

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="shanlu"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">shanlu</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">127</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">11</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">11</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/shanlu123" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;shanlu123"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.cnblogs.com/shanlu0000/p/11478994.html" title="博客园 → https:&#x2F;&#x2F;www.cnblogs.com&#x2F;shanlu0000&#x2F;p&#x2F;11478994.html" rel="noopener" target="_blank"><i class="fa fa-blog fa-fw"></i>博客园</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:yourname@gmail.com" title="E-Mail → mailto:yourname@gmail.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/u/6662419816/home?wvr=5" title="微博 → https:&#x2F;&#x2F;weibo.com&#x2F;u&#x2F;6662419816&#x2F;home?wvr&#x3D;5" rel="noopener" target="_blank"><i class="fab fa-weibo fa-fw"></i>微博</a>
      </span>
  </div>


  <div class="links-of-blogroll animated">
    <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://www.npmjs.com/" title="https:&#x2F;&#x2F;www.npmjs.com&#x2F;" rel="noopener" target="_blank">npm</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.bilibili.com/" title="https:&#x2F;&#x2F;www.bilibili.com&#x2F;" rel="noopener" target="_blank">bilibili</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://stackoverflow.com/" title="https:&#x2F;&#x2F;stackoverflow.com&#x2F;" rel="noopener" target="_blank">stackoverflow</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://developers.weixin.qq.com/miniprogram/dev/component/" title="https:&#x2F;&#x2F;developers.weixin.qq.com&#x2F;miniprogram&#x2F;dev&#x2F;component&#x2F;" rel="noopener" target="_blank">小程序</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="http://www.ruanyifeng.com/blog/" title="http:&#x2F;&#x2F;www.ruanyifeng.com&#x2F;blog&#x2F;" rel="noopener" target="_blank">阮一峰</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://cn.aliyun.com/" title="https:&#x2F;&#x2F;cn.aliyun.com&#x2F;" rel="noopener" target="_blank">阿里云</a>
        </li>
    </ul>
  </div>

      </section>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">
      

      

    
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://github.com/shanlu123/2020/09/26/%E5%AF%86%E7%A0%81%E5%AD%A6/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%A6%82%E8%BF%B0/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="shanlu">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="shanlu的博客">
    </span>

    
    
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          密码学概述
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-09-26 00:00:00" itemprop="dateCreated datePublished" datetime="2020-09-26T00:00:00+08:00">2020-09-26</time>
    </span>
      <span class="post-meta-item">
        <span class="post-meta-item-icon">
          <i class="far fa-calendar-check"></i>
        </span>
        <span class="post-meta-item-text">更新于</span>
        <time title="修改时间：2020-10-04 17:07:18" itemprop="dateModified" datetime="2020-10-04T17:07:18+08:00">2020-10-04</time>
      </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%AF%86%E7%A0%81%E5%AD%A6/" itemprop="url" rel="index"><span itemprop="name">密码学</span></a>
        </span>
    </span>

  
    <span id="/2020/09/26/%E5%AF%86%E7%A0%81%E5%AD%A6/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%A6%82%E8%BF%B0/" class="post-meta-item leancloud_visitors" data-flag-title="密码学概述" title="阅读次数">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span class="leancloud-visitors-count"></span>
    </span>
    <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2020/09/26/%E5%AF%86%E7%A0%81%E5%AD%A6/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%A6%82%E8%BF%B0/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/09/26/%E5%AF%86%E7%A0%81%E5%AD%A6/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%A6%82%E8%BF%B0/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>2.8k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>3 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h3 id="密码学主要解决的问题"><a href="#密码学主要解决的问题" class="headerlink" title="密码学主要解决的问题"></a>密码学主要解决的问题</h3><ul>
<li>信息的机密性、完整性、不可否认性和可用性</li>
<li>机密性：对传送的信息进行加密就可以实现机密性，保证信息不泄露给未经授权的人。</li>
<li>完整性：防止信息被未经授权的人篡改，保证信息不被篡改</li>
<li>不可否认性：保证信息行为人不能否认其信息行为</li>
<li>可用性：保证信息及信息系统确实为授权使用者所用</li>
</ul>
<h3 id="密码学起源与发展"><a href="#密码学起源与发展" class="headerlink" title="密码学起源与发展"></a>密码学起源与发展</h3><ol>
<li>古典密码学<ol>
<li>典型的古典密码算法包括凯撒（Caeser) 密码和维基利亚（Vigenere）密码</li>
<li>主要特点：数据的安全基于算法的保密</li>
</ol>
</li>
<li>近代密码学<ol>
<li>主要特点：数据的安全基于密钥而不是算法的保密</li>
</ol>
</li>
<li>现代密码学<ol>
<li>RSA公钥密码算法</li>
<li>椭圆曲线等其他公钥算法</li>
</ol>
</li>
</ol>
<h3 id="密码学概念"><a href="#密码学概念" class="headerlink" title="密码学概念"></a>密码学概念</h3><ul>
<li>密码学：研究信息系统安全保密的科学，包含两个分支：密码编码学和密码分析学</li>
<li>密码编码学：主要研究密码方案的设计，即寻找对信息进行编码的方法从而隐藏信息的一门学问。主要目的是寻求保证信息的保密性或认证性的方法</li>
<li>密码分析学：主要是从攻击者的角度来看问题，研究如何破解被隐藏信息的一门学问。主要目的是研究加密的破译或信息的伪造。</li>
</ul>
<h3 id="密码系统构成"><a href="#密码系统构成" class="headerlink" title="密码系统构成"></a>密码系统构成</h3><ul>
<li>明文(plaintext)：希望得到保密的原始信息</li>
<li>密文(ciphertext)：明文经过密码交换后的消息</li>
<li>加密(encryption)：由明文变换为密文的过程</li>
<li>解密(decryption)：从密文恢复出明文的过程</li>
<li>加密算法(encryption algorithm)：对明文进行加密时采用的一组规则</li>
<li>解密算法：对密文进行解密时采用的一组规则</li>
<li>密钥(key)：密码系统的关键，控制加密和解密算法操作的信息。加解密算法通常都是在一组密钥的控制下进行的，分别称为加密密钥和解密密钥。</li>
</ul>
<h3 id="密码系统数学模型"><a href="#密码系统数学模型" class="headerlink" title="密码系统数学模型"></a>密码系统数学模型</h3><ul>
<li>以五元组(M，C，K，E，D) 表示密码系统，M是明文信息空间，C是密文信息空间，K是密钥信息空间，E是加密算法，D是解密算法</li>
<li>E：M x K -&gt; C，表示E是M与K到C的一个映射</li>
<li>D：C x K -&gt; M，表示D是C与K到M的一个映射</li>
<li>发送消息的一方使用密钥K1加密明文M，通过加密算法得到密文C，即C=Ek1（M）</li>
<li>接收消息的一方使用功能密钥 K2解密密文C，通过解密算法得到明文M，即M=Dk2(C)</li>
<li>K1与K2可能相等，可能不等</li>
</ul>
<h3 id="凯撒密码体制"><a href="#凯撒密码体制" class="headerlink" title="凯撒密码体制"></a>凯撒密码体制</h3><ul>
<li><p><img src="C:\Users\高萍\AppData\Roaming\Typora\typora-user-images\image-20200926111012355.png" alt="image-20200926111012355"></p>
</li>
<li><p>加密算法：（M+K）mod 26</p>
</li>
<li><p>解密算法：（C-K ） mod 26</p>
</li>
<li><p>密钥：K=5</p>
</li>
<li><p>例如：</p>
<figure class="highlight angelscript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">明文：hello (<span class="number">7</span>,<span class="number">4</span>,<span class="number">11</span>,<span class="number">11</span>,<span class="number">14</span>)</span><br><span class="line">密文：(<span class="number">12</span>,<span class="number">9</span>,<span class="number">16</span>,<span class="number">16</span>,<span class="number">19</span>) -&gt; mjqqt</span><br><span class="line">解密出明文：(<span class="number">7</span>,<span class="number">4</span>,<span class="number">11</span>,<span class="number">11</span>,<span class="number">14</span>) -&gt; hello</span><br></pre></td></tr></table></figure>

</li>
</ul>
<h3 id="保密系统"><a href="#保密系统" class="headerlink" title="保密系统"></a>保密系统</h3><p>保密系统应当满足的要求：</p>
<ul>
<li>系统及时达不到理论上不可破的，也应当是实际上不可破的。从解惑的密文或已知明文-密文对，要确定密钥或任何明文，在计算上不可行。</li>
<li>系统的保密性不依赖于对加密体制或算法的保密，而依赖于密钥。</li>
<li>加密和解密算法使用密钥空间中的所有元素</li>
<li>系统便于实现和使用</li>
</ul>
<h3 id="认证与认证系统"><a href="#认证与认证系统" class="headerlink" title="认证与认证系统"></a>认证与认证系统</h3><p><strong>认证系统：</strong></p>
<ul>
<li>防止消息被篡改，删除，重放和伪造</li>
<li>发送的消息能够被验证</li>
<li>接受者或第三者能够识别和确认消息的真伪</li>
</ul>
<p><strong>保密性</strong>：截获者在不知密钥条件下不能解读密文内容</p>
<p><strong>认证性：</strong>任何不知道密钥的人不能构造一个密文，意定的接收者解密成一个可理解的消息（合法的消息）</p>
<h3 id="密钥体制分类"><a href="#密钥体制分类" class="headerlink" title="密钥体制分类"></a>密钥体制分类</h3><ol>
<li><strong>按密钥特点划分</strong><ol>
<li>对称密码体制<ol>
<li>单钥密码体制，私钥密码体制，传统密码体制</li>
<li>加密密钥和解密密钥相同或彼此之间容易互相确定</li>
<li>不仅可用于数据加密，还可用于消息认证</li>
<li>根据加密方式可以将对称密码体制分为：流密码、分组密码</li>
</ol>
</li>
<li>非对称密码体制<ol>
<li>双钥密码体制，公钥密码体制</li>
<li>加密密钥和解密密钥不同，并且从一个难以推出另一个</li>
<li>加密密钥对外公开，所有人都可知，公钥</li>
<li>解密密钥，私钥，只有特定用户方才有</li>
</ol>
</li>
</ol>
</li>
<li><strong>按保密程度来分</strong><ol>
<li>实际上保密的密码体制<ol>
<li>理论上可破解，计算上不可行</li>
<li>当前广泛使用的各类密码方案，除一次一密外，其余都是实际上保密的密码体制</li>
</ol>
</li>
<li>绝对保密的密码体制<ol>
<li>理论上和实际上都不可破解</li>
<li>一次一密密码体制是绝对保密的</li>
</ol>
</li>
</ol>
</li>
</ol>
<h3 id="流密码和分组密码（对称密码体制）"><a href="#流密码和分组密码（对称密码体制）" class="headerlink" title="流密码和分组密码（对称密码体制）"></a>流密码和分组密码（对称密码体制）</h3><p><strong>流密码</strong></p>
<ul>
<li>将明文一次加密一个比特或多个比特形成密码字符串</li>
<li>典型的流密码有一次一密，其密钥长度与明文长度相等</li>
</ul>
<p><strong>分组密码</strong></p>
<ul>
<li>将明文分组，每组具有固定长度，然后将一个分组作为整体通过加密算法产生对应密文</li>
<li>各组之间是否有关联关系根据具体的加密模式决定</li>
<li>典型的分组密码：DES，AES等。</li>
</ul>
<h3 id="流密码和分组密码主要区别："><a href="#流密码和分组密码主要区别：" class="headerlink" title="流密码和分组密码主要区别："></a>流密码和分组密码主要区别：</h3><ul>
<li>流密码的加密变换是时变的</li>
<li>分组密码的加密变换是固定不变的。</li>
</ul>
<p><strong>公钥密码系统模型</strong></p>
<p><strong>加密模型</strong></p>
<img src="C:\Users\高萍\AppData\Roaming\Typora\typora-user-images\image-20200926114849663.png" alt="image-20200926114849663" style="zoom: 67%;" />



<p><strong>认证模型</strong></p>
<img src="C:\Users\高萍\AppData\Roaming\Typora\typora-user-images\image-20200926114859071.png" alt="image-20200926114859071" style="zoom:67%;" />

<p><strong>主要特点</strong></p>
<ul>
<li>加密和解密能力公开</li>
<li>可以实现多个用户加密的消息只能由一个用户解读——–用于公共网络中实现保密通信</li>
<li>只能由一个用户加密消息而使多个用户可以解读——用于认证系统中对消息进行数字签名</li>
<li>无需事先分配密钥</li>
</ul>
<h3 id="对称密码体制与非对称密码体制优缺点"><a href="#对称密码体制与非对称密码体制优缺点" class="headerlink" title="对称密码体制与非对称密码体制优缺点"></a>对称密码体制与非对称密码体制优缺点</h3><p><strong>对称密码体制</strong></p>
<ul>
<li>优点：加密速度快、效率高、广泛用于大信息量的加密</li>
<li>缺点：密钥传输与交换面临威胁，密钥容易被截获；若和大量用户通信，难以安全管理大量密钥，大范围应用存在问题</li>
</ul>
<p><strong>非对称密码体制</strong></p>
<ul>
<li>优点：很好解决对称加密中由于密钥数量过多难以管理和费用高等问题，不用担心传输中私钥泄漏，保密性能高</li>
<li>缺点：加密算法复杂，加密速度慢</li>
</ul>
<h3 id="密码系统攻击"><a href="#密码系统攻击" class="headerlink" title="密码系统攻击"></a>密码系统攻击</h3><p><strong>被动攻击</strong></p>
<ul>
<li>通过窃取密文试图了解明文或者密钥的内容</li>
</ul>
<p><strong>主动攻击</strong></p>
<ul>
<li>篡改和伪造密文，以达到修改或者伪造明文的目的</li>
</ul>
<p><strong>攻击类型</strong></p>
<ol>
<li>唯密文攻击<ol>
<li>有一个或多个用同一密钥加密的密文</li>
<li>通过对这些截获的密文进行分析得出明文或密钥</li>
</ol>
</li>
<li>已知明文攻击<ol>
<li>待解密文+一些明文+用同一密钥加密这些明文的对应密文</li>
</ol>
</li>
<li>选择明文攻击<ol>
<li>可得到所需要的任何明文对应密文，这些密文与待解密文是用同意密钥</li>
</ol>
</li>
<li>选择密文攻击<ol>
<li>可得到所需任何密文的对应明文，解密这些密文所使用的密钥与解密待解密文的密钥一样。</li>
</ol>
</li>
<li>强度按序递增，唯密文工作最弱，选择密文攻击最强</li>
</ol>
<h3 id="古典密码"><a href="#古典密码" class="headerlink" title="古典密码"></a><strong>古典密码</strong></h3><ul>
<li>属于对称密码体制，加密和解密使用同一密钥</li>
<li>基于对明文信息的“置换”或“替代”完成</li>
<li>栅栏密码（置换密码体制）</li>
</ul>
<blockquote>
<p><strong>加密：</strong></p>
<ol>
<li>将明文的元素按照两行的方式书写，从上到下，从左到右</li>
<li>按从上到写的顺序依次读取每一行元素所得到的的组合就是密文</li>
</ol>
<p><strong>解密：</strong></p>
<ol>
<li>将接受的密文按从左到右顺序写为两行，如果密文个数为偶数n，每一行写n/2个元素，如果密文个数为奇数，第一行排 (n+1) /2 个元素，第二行排 (n-1)/2 个元素；</li>
<li>按加密算法规则，从上到下，从左到右读取各元素，得到明文</li>
</ol>
<p><strong>例如：</strong></p>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">明文：economic business</span><br><span class="line">加密：e o o <span class="selector-tag">i</span> <span class="selector-tag">b</span> s n s</span><br><span class="line">	 c n m c u <span class="selector-tag">i</span> e s</span><br><span class="line">密文: eonibsnscnmcuies</span><br><span class="line">解密：e o o <span class="selector-tag">i</span> <span class="selector-tag">b</span> s n s</span><br><span class="line">	 c n m c u <span class="selector-tag">i</span> e s</span><br><span class="line">解密出明文：economicbusiness</span><br></pre></td></tr></table></figure>
</blockquote>
<ul>
<li>置换法破译：通过字母的使用频率破译</li>
<li>替代法<ul>
<li>凯撒加密：把每个英文字母向后推移K位，即将明文中的每个元素用各自后面对应的第K个字符代替</li>
<li>替代方式<ul>
<li>单字母替换，如凯撒密码</li>
<li>多字母替换，也称密码本式替换，将一个或一组字符分别用多个字符一起替换，如将 efe 替换为 awt</li>
<li>插入式替换，将明文信息插入到其他信息中，如把明文中各元素插入到一段文章中</li>
</ul>
</li>
</ul>
</li>
</ul>

    </div>

    
    
    

    
      <div>
       <div>
  
    <div style="text-align:center;color:#bfbfbf;font-size:16px;">
      <span>-------- 本文结束 </span>
      <i class="fa fa-snowflake-o"></i>
      <span> 感谢阅读 --------</span>
    </div>
  
</div>
      </div>
    

    <footer class="post-footer">
          <div class="reward-container">
  <div></div>
  <button onclick="document.querySelector('.post-reward').classList.toggle('active');">
    赞赏
  </button>
  <div class="post-reward">
      <div>
        <img src="/images/wechatpay.png" alt="shanlu 微信">
        <span>微信</span>
      </div>

  </div>
</div>

          <div class="post-tags">
              <a href="/tags/%E5%AF%86%E7%A0%81%E5%AD%A6/" rel="tag"><i class="fa fa-tag"></i> 密码学</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2020/09/26/%E5%AF%86%E7%A0%81%E5%AD%A6/%E6%95%B0%E8%AE%BA%E7%AE%80%E4%BB%8B/" rel="prev" title="数论">
                  <i class="fa fa-chevron-left"></i> 数论
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2020/09/26/python/%E7%AC%AC%E4%B8%80%E4%B8%AApython%E7%A8%8B%E5%BA%8F/" rel="next" title="关于python">
                  关于python <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
  
  
  



      
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      const commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

    </div>
  </main>

  <footer class="footer">
    <div class="footer-inner">
      

      

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">shanlu</span>
</div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
    <span title="站点总字数">225k</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">3:25</span>
  </span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>


    <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

    </div>
  </footer>

  
  <script size="300" alpha="0.6" zIndex="-1" src="//cdn.jsdelivr.net/npm/ribbon.js@1.0.2/dist/ribbon.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/animejs@3.2.0/lib/anime.min.js"></script>
<script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  
  <script>
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>




  <script src="/js/local-search.js"></script>















  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>








  

  
<script>
NexT.utils.loadComments('#valine-comments', () => {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js', () => {
    new Valine(Object.assign({
      el  : '#valine-comments',
      path: "/2020/09/26/%E5%AF%86%E7%A0%81%E5%AD%A6/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%A6%82%E8%BF%B0/",
    }, {"enable":true,"appId":"M0TTE46ti90I3BUUJqD5WYyD-gzGzoHsz","appKey":"UelegRsJXosPYDakAbUdO5e8","notify":true,"verify":false,"placeholder":"留下评论吧","avatar":"mm","meta":["nick","mail","link"],"pageSize":10,"lang":"zh-cn","visitor":true,"comment_count":true,"recordIP":false,"serverURLs":null,"enableQQ":false,"requiredFields":[]}
    ));
  }, window.Valine);
});
</script>

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"position":"left","width":225,"height":450},"mobile":{"show":true},"react":{"opacity":0.7},"log":false});</script></body>
</html>
